<?php 
	header('content-type:text/html;charset=utf8');
	$pdo = new PDO('mysql:host=localhost;dbname=month8;charset=utf8');
 	$redis = new redis();
 	$redis->connect('127.0.0.1','6379');

 	$id = $_GET['id'];
 	$sql = "SELECT * FROM  weather where id = $id";
 	$data=$pdo->query($sql)->fetch();	
 	if($reids->get("visit".$id)){
 		$redis->incr('visit'.$id);
 		$visit = $redis->get('visit'.$id);
 	}else{
 		$redis->set('visit'.$id,1);
 		$visit = $redis->get('visit'.$id);
 	}
 ?>
 <!DOCTYPE html>
 <html lang="en">
 <head>
 	<meta charset="UTF-8">
 	<title>Document</title>
 </head>
 <body>
 	<center>
 		<table>
 			<tr>
 				<td>商品名</td>
 				<td>价格</td>
 				<td>数量</td>
 			</tr>
 			<tr>
 				<td><?php echo $data['name'];?></td>
 				<td><?php echo $data['money'];?></td>
 				<td>100</td>
 			</tr>
 		</table>
 	</center>
 </body>
 </html>